package org.xuk.spring.ws.service.impl;

import org.springframework.stereotype.Service;
import org.xuk.spring.ws.model.BoardCastMessage;
import org.xuk.spring.ws.model.SingleMessage;
import org.xuk.spring.ws.service.MessageSendService;
import org.xuk.spring.ws.service.ProducerClient;

@Service
public class MessageSendServiceImpl implements MessageSendService {
    private final ProducerClient producerClient;

    public MessageSendServiceImpl(ProducerClient producerClient) {
        this.producerClient = producerClient;
    }

    @Override
    public Boolean singleSend(SingleMessage singleMessage) {
        producerClient.singleSend(singleMessage);
        return true;
    }

    @Override
    public Boolean boardCastSend(BoardCastMessage boardCastMessage) {
        producerClient.boardCastSend(boardCastMessage);
        return true;
    }
}
